Skip to content

fix(docker): apply host networking via compose override in dockerw - #257

Open
cleithner-comcast wants to merge 4 commits into
mainfrom
cleith/dev/fixHostNetworkCompose
Open

fix(docker): apply host networking via compose override in dockerw#257
cleithner-comcast wants to merge 4 commits into
mainfrom
cleith/dev/fixHostNetworkCompose

Conversation

@cleithner-comcast

Copy link
Copy Markdown
Contributor

The dockerw -H flag passed "--network host" to "docker compose run", but that flag only exists for "docker run"; "docker compose run" rejects it with an unknown-flag error. Apply host networking by layering the existing docker/compose.host-network.yaml override instead, matching the devcontainer mechanism.

The dockerw -H flag passed "--network host" to "docker compose run", but
that flag only exists for "docker run"; "docker compose run" rejects it with
an unknown-flag error. Apply host networking by layering the existing
docker/compose.host-network.yaml override instead, matching the devcontainer
mechanism.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes dockerw -H host-networking behavior by switching from an invalid docker compose run --network host flag (unsupported by docker compose run) to layering the existing docker/compose.host-network.yaml override, aligning with the devcontainer approach.

Changes:

  • Replace --network host flag usage with a host-network compose override file when -H is provided.
  • Refactor compose invocation to support multiple -f files (base + optional override).
Suppressed comments (1)

dockerw:84

  • With COMPOSE_FILES as an array, pass it as "${COMPOSE_FILES[@]}" so each -f and its path remain separate arguments even when the working directory contains spaces.
docker compose ${COMPOSE_FILES} run \

Comment thread dockerw Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 4, 2026 14:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

dockerw:84

  • COMPOSE_FILES is a bash array, but ${COMPOSE_FILES} expands to only the first element (${COMPOSE_FILES[0]}), so the compose file paths are not passed and the command will fail/misbehave. Expand the full array with "${COMPOSE_FILES[@]}".
docker compose ${COMPOSE_FILES} run \

tleacmcsa
tleacmcsa previously approved these changes Aug 4, 2026
COMPOSE_FILES was assigned as a bash array but referenced with scalar
${COMPOSE_FILES}, which expands to only the first element (-f). That turned
the invocation into "docker compose -f run ...", where -f consumed "run" as
the compose-file path and "--rm" was parsed as a top-level flag, failing with
"unknown flag: --rm". Expand with "${COMPOSE_FILES[@]}" instead.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 6, 2026 16:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

dockerw:72

  • If this script runs with set -u/nounset, referencing an unset HOST_NETWORK will error. Prefer using a default expansion in the test (e.g., check ${HOST_NETWORK:-}) or initialize HOST_NETWORK to an empty value before option parsing.
if [ -n "$HOST_NETWORK" ]; then
    COMPOSE_FILES+=(-f "${DIR}/docker/compose.host-network.yaml")
fi

Comment thread dockerw
Comment thread dockerw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants